package com.tianji.api.client.remark.fallback;

import com.tianji.api.client.remark.LikesClients;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;

import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
 * @author Xinxuan Zhuo
 * @version 2024/3/4
 * <p>
 *
 * </p>
 */

@Slf4j
public class LikesClientFallback implements FallbackFactory<LikesClients> {

    @Override
    public LikesClients create(Throwable cause) {
        log.error("remark-service服务异常");
        return new LikesClients() {
            @Override
            public Set<Long> isBizLiked(List<Long> bizIds) {
                return new HashSet<>();
            }
        };

    }


}
